const express=require('express')
const expressJoi=require('@escook/express-joi')
const { add_article_schema}=require('../schema/article')
const article_handler=require('../router_handle/article')
const router=express.Router()
// 导入multer模块，解析表单对象
const multer = require('multer')
const path=require('path')
// 创建multer实例对象
const uploads=multer({dest:path.join(__dirname,'../uploads')})

router.post('/add', uploads.single('cover_img'), expressJoi(add_article_schema),article_handler.addArticle)
module.exports=router